/**
 * Created by Administrator on 2016/11/30.
 */
public class Singleton {
    private int count = 0;
    private static class SingletonHolder{
        public static Singleton singleton = new Singleton();
    }

    private Singleton(){}

    public static Singleton newInstance(){
        return SingletonHolder.singleton;
    }

    public void outCount(){
        System.out.println("count= " + count);

        count++;
    }
}
